package com.cskaoyan.factory;

import org.springframework.beans.factory.FactoryBean;

/**
 * @author stone
 * @date 2022/03/21 11:31
 */
public class CarFactoryBean implements FactoryBean<Car> {

    @Override
    public Car getObject() throws Exception {
        //getObject方法里怎么样获得实例都行：构造方法、反射、代理
        Car car = new Car();
        car.setType("factoryBean");
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }
}
